#include "aicommandendtrip.h"

namespace IAlib
{

AiCommandEndTrip::AiCommandEndTrip()
{
    AiCommand::setType(COMMAND_END_TRIP);
}

QByteArray AiCommandEndTrip::toByteArray() const
{
    QByteArray byte_array;
    QDataStream data(&byte_array, QIODevice::WriteOnly);

    data<<getMode();
    data<<getAgentId();

    return byte_array;
}

void AiCommandEndTrip::fromByteArray(QByteArray &byte_array)
{
    QDataStream data(&byte_array, QIODevice::ReadOnly);
    int i_temp;

    data>>i_temp;
    setMode((AiCommand::CommandMode)i_temp);
    data>>m_agent_id;
}

}
